package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 天气数据表
 * @TableName weather_data
 */
@TableName(value ="weather_data")
@Data
public class WeatherData implements Serializable {
    /**
     * 天气ID
     */
    @TableId(type = IdType.AUTO)
    private Long weatherId;

    /**
     * 位置编码
     */
    private String locationCode;

    /**
     * 天气日期
     */
    private Date weatherDate;

    /**
     * 温度
     */
    private BigDecimal temperature;

    /**
     * 湿度
     */
    private BigDecimal humidity;

    /**
     * 气压
     */
    private BigDecimal pressure;

    /**
     * 风速
     */
    private BigDecimal windSpeed;

    /**
     * 风向
     */
    private String windDirection;

    /**
     * 降雨量
     */
    private BigDecimal rainfall;

    /**
     * 天气状况
     */
    private String weatherCondition;

    /**
     * 创建时间
     */
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        WeatherData other = (WeatherData) that;
        return (this.getWeatherId() == null ? other.getWeatherId() == null : this.getWeatherId().equals(other.getWeatherId()))
            && (this.getLocationCode() == null ? other.getLocationCode() == null : this.getLocationCode().equals(other.getLocationCode()))
            && (this.getWeatherDate() == null ? other.getWeatherDate() == null : this.getWeatherDate().equals(other.getWeatherDate()))
            && (this.getTemperature() == null ? other.getTemperature() == null : this.getTemperature().equals(other.getTemperature()))
            && (this.getHumidity() == null ? other.getHumidity() == null : this.getHumidity().equals(other.getHumidity()))
            && (this.getPressure() == null ? other.getPressure() == null : this.getPressure().equals(other.getPressure()))
            && (this.getWindSpeed() == null ? other.getWindSpeed() == null : this.getWindSpeed().equals(other.getWindSpeed()))
            && (this.getWindDirection() == null ? other.getWindDirection() == null : this.getWindDirection().equals(other.getWindDirection()))
            && (this.getRainfall() == null ? other.getRainfall() == null : this.getRainfall().equals(other.getRainfall()))
            && (this.getWeatherCondition() == null ? other.getWeatherCondition() == null : this.getWeatherCondition().equals(other.getWeatherCondition()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getWeatherId() == null) ? 0 : getWeatherId().hashCode());
        result = prime * result + ((getLocationCode() == null) ? 0 : getLocationCode().hashCode());
        result = prime * result + ((getWeatherDate() == null) ? 0 : getWeatherDate().hashCode());
        result = prime * result + ((getTemperature() == null) ? 0 : getTemperature().hashCode());
        result = prime * result + ((getHumidity() == null) ? 0 : getHumidity().hashCode());
        result = prime * result + ((getPressure() == null) ? 0 : getPressure().hashCode());
        result = prime * result + ((getWindSpeed() == null) ? 0 : getWindSpeed().hashCode());
        result = prime * result + ((getWindDirection() == null) ? 0 : getWindDirection().hashCode());
        result = prime * result + ((getRainfall() == null) ? 0 : getRainfall().hashCode());
        result = prime * result + ((getWeatherCondition() == null) ? 0 : getWeatherCondition().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", weatherId=").append(weatherId);
        sb.append(", locationCode=").append(locationCode);
        sb.append(", weatherDate=").append(weatherDate);
        sb.append(", temperature=").append(temperature);
        sb.append(", humidity=").append(humidity);
        sb.append(", pressure=").append(pressure);
        sb.append(", windSpeed=").append(windSpeed);
        sb.append(", windDirection=").append(windDirection);
        sb.append(", rainfall=").append(rainfall);
        sb.append(", weatherCondition=").append(weatherCondition);
        sb.append(", createTime=").append(createTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}